import {
  createRouter,
  createWebHashHistory,
  RouteLocationRaw,
  Router
} from 'vue-router';
import routes from './routes';

const router: Router = createRouter({
  //history: createWebHashHistory("/yccsqx"),
  history: createWebHashHistory(),
  routes: routes
});

export function routerPush(to: RouteLocationRaw) {
  router.push(to)
}

export function routerReplace(to: RouteLocationRaw) {
  router.replace(to)
}

export function routerBack() {
  router.back()
}

export function routerForward() {
  router.forward()
}

export function routerGo(delta: number) {
  router.go(delta)
}

// router.beforeEach((to, from, next) => {
//   next()
// });

export default router;
